import { getAction, deleteAction, putAction, postAction, httpAction, downFile } from '@/api/manage'
const serviceName = '/sjsk-clinicmanage-service/sjsk'
/*-----------诊所管理-----------*/
const getPageList = (params) => postAction(`${serviceName}/clinic/page`, params)
const addClinic = (params) => postAction(`${serviceName}/clinic/add`, params)
const getClinicById = (params) => getAction(`${serviceName}/clinic/getClinicById`, params)
const updateClinicById = (params) => postAction(`${serviceName}/clinic/updateClinicById`, params)
const updateStatusById = (params) => postAction(`${serviceName}/clinic/updateStatusById`, params)
const exportClinics = (params) => downFile(`${serviceName}/clinic/exportClinics`, params, 'post')
const allClinicRegion = () => postAction(`${serviceName}/clinic/allClinicRegion`)
const allClinicInfo = () => postAction(`${serviceName}/clinic/allClinicInfo`)
const getClinicNameByRegion = (params) => getAction(`${serviceName}/clinic/getClinicNameByRegion`, params)


/*-----------人员管理-----------*/
const personList = (params) => postAction(`${serviceName}/person/page`, params)
const setTerm = (params) => postAction(`${serviceName}/person/setTerm`, params)
const getTerm = (params) => postAction(`${serviceName}/person/getTerm`, params)
const getPatientById = (params) => getAction(`${serviceName}/person/personInfo`, params)
const exportGroupPersons = (params) => downFile(`${serviceName}/person/exportGroupPersons`, params, 'post')

/*-----------药物记录-----------*/
const addCureRecordById = (params) => postAction(`${serviceName}/takeCure/addCureRecordById`, params)
const getCureRecordsById = (params) => postAction(`${serviceName}/takeCure/page`, params)
const getLossDaysByPid = (params) => getAction(`${serviceName}/takeCure/getLossDaysByPid`, params)
const getTakeCureInfoByPid = (params) => getAction(`${serviceName}/takeCure/getTakeCureInfo`, params)

/*-----------转诊-----------*/
const referralPage = (params) => postAction(`${serviceName}/referral/page`, params)
const addReferralByPid = (params) => postAction(`${serviceName}/referral/addReferralByPid`, params)
const exportReferralRecords = (params) => downFile(`${serviceName}/referral/exportReferralRecords`, params, 'post')
const getClinicDetailsByPid = (params) => getAction(`${serviceName}/referral/getClinicDetailsByPid`, params)
const getRecordByPid = (params) => getAction(`${serviceName}/referral/getRecordByPid`, params)
const getRecordById = (params) => getAction(`${serviceName}/referral/getRecordById`, params)

/*-----------退诊-----------*/
const withdrawalPage = (params) => postAction(`${serviceName}/withdrawal/page`, params)
const addWithdrawalByPid = (params) => postAction(`${serviceName}/withdrawal/addWithdrawalByPid`, params)
const exportWithdrawalRecords = (params) => downFile(`${serviceName}/withdrawal/exportWithdrawalRecords`, params, 'post')
const getWithdrawalByPid = (params) => getAction(`${serviceName}/withdrawal/getWithdrawalByPid`, params)

export {
  allClinicInfo,
  getClinicNameByRegion,
  allClinicRegion,
  getTakeCureInfoByPid,
  getRecordById,
  getPageList,
  addClinic,
  getClinicById,
  updateClinicById,
  updateStatusById,
  exportClinics,
  personList,
  setTerm,
  getTerm,
  getPatientById,
  exportGroupPersons,
  addCureRecordById,
  getCureRecordsById,
  getLossDaysByPid,
  referralPage,
  addReferralByPid,
  exportReferralRecords,
  getClinicDetailsByPid,
  getRecordByPid,
  withdrawalPage,
  addWithdrawalByPid,
  exportWithdrawalRecords,
  getWithdrawalByPid,
}
